Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define 'GetLedgerView' for Babbage. #2711

Merged
merged 1 commit into from
Mar 30, 2022
Merged

Define 'GetLedgerView' for Babbage. #2711

merged 1 commit into from
Mar 30, 2022

Conversation

nc6
Copy link
Contributor

@nc6 nc6 commented Mar 30, 2022

This instance is a little (well, a lot) suspicious, since we don't
actually have extra entropy in Babbage. We rely on the fact that this
type is only used to construct the Praos ledger view, which is much
simler (it looks like this:

data LedgerView crypto = LedgerView
  { -- | Stake distribution
    lvPoolDistr     :: SL.PoolDistr crypto,
    -- | Maximum header size
    lvMaxHeaderSize :: !Natural,
    -- | Maximum block body size
    lvMaxBodySize   :: !Natural
  }
  deriving (Show)

). So the error field will be thrown away without being evaluated.

At some point we should make this situation better, but not before the
Vasil HF.

This instance is a little (well, a lot) suspicious, since we don't
actually have extra entropy in Babbage. We rely on the fact that this
type is only used to construct the `Praos` ledger view, which is much
simler (it looks like this:

```
data LedgerView crypto = LedgerView
  { -- | Stake distribution
    lvPoolDistr     :: SL.PoolDistr crypto,
    -- | Maximum header size
    lvMaxHeaderSize :: !Natural,
    -- | Maximum block body size
    lvMaxBodySize   :: !Natural
  }
  deriving (Show)
```
). So the `error` field will be thrown away without being evaluated.

At some point we should make this situation better, but not before the
Vasil HF.
@nc6 nc6 requested a review from JaredCorduan March 30, 2022 09:43
} =
LedgerView
{ lvD = getField @"_d" . esPp $ nesEs,
lvExtraEntropy = error "Extra entropy is not set in the Babbage era",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it would be less scary to use the neutral nonce? though perhaps failing hard is better? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to go for failing hard, though I could be argued the other way!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fail hard!

Do not go gentle into that good night,
Old age should burn and rave at close of day;
Rage, rage against the dying of the light.

@nc6 nc6 merged commit b60c3e6 into master Mar 30, 2022
@iohk-bors iohk-bors bot deleted the nc/glv-babbage branch March 30, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants